<?php
if (isset($query) && count($query) > 0) {
    ?>
    <h1>Data Guru</h1>
    <table width="400" border="1" class="table table-striped">
        <thead>
            <tr>
                <th>#</th>
                <th>NIP</th>
                <th>Nama</th>
                <th>Edit</th>
                <th>Delete</th>
            </tr>
        </thead>
        <?php
        $i = 0;
        foreach ($query as $row) {
            $i++;
            echo "<tr class=\"record\">";
            echo "<td>$i</td>";
            echo "<td>$row->nip</td>";
            echo "<td>$row->nama</td>";
            echo "<td><a href='" . base_url() . "admin/guru/edit/$row->id' class='fancybox fancybox.iframe input'>Edit</a></td>";
            echo "<td><a href='" . base_url() . "admin/guru/delconf/$row->id' class='fancybox fancybox.iframe input'>Delete</a></td>";
            echo "</tr>";
        }
        ?>
    </table>
    <?php
}
?>